]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
keyboard: Do key presses on actual key press
authorCarlos Garnacho <carlosg@gnome.org>
Wed, 14 Feb 2018 11:39:27 +0000 (12:39 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Thu, 15 Feb 2018 18:36:03 +0000 (19:36 +0100)
It was mistakenly connecting twice to the 'released' signal. Also, move
level changes to key release, since it will be more convenient to hook
latched states on long press.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/46

js/ui/keyboard.js

index 5864fd5f5d28c17b55363cf6cb0679de8f64e1c4..2701669975e3d396c1f2531e6e584b5e11d10696 100644 (file)
@@ -807,14 +807,14 @@ var Keyboard = new Lang.Class({
 
             let actor = extraButton.keyButton;
 
+            extraButton.connect('pressed', Lang.bind(this, function() {
+                if (keyval != null)
+                    this._keyboardController.keyvalPress(keyval);
+            }));
             extraButton.connect('released', Lang.bind(this, function() {
                 if (switchToLevel != null)
                     this._onLevelChanged(switchToLevel);
                 else if (keyval != null)
-                    this._keyboardController.keyvalPress(keyval);
-            }));
-            extraButton.connect('released', Lang.bind(this, function() {
-                if (keyval != null)
                     this._keyboardController.keyvalRelease(keyval);
                 else if (action == 'hide')
                     this.hide();